package leetcode.code0124;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;
import leetcode.helper.tree.TreeArray;
import leetcode.helper.tree.TreeNode;

public abstract class Solution124 implements IDebug {
	public abstract int maxPathSum(TreeNode root);

	@Override
	public void debug1() {
		String str = "[1,2,3]";
		TreeNode root = TreeArray.array2tree(HelpDebug.str2array4(str));
		int e = 6;
		int r = this.maxPathSum(root);
		HelpDebug.compare(e, r);
	}

	@Override
	public void debug2() {
		String str = "[-10,9,20,null,null,15,7]";
		TreeNode root = TreeArray.array2tree(HelpDebug.str2array4(str));
		int e = 42;
		int r = this.maxPathSum(root);
		HelpDebug.compare(e, r);
	}

	@Override
	public void debug3() {
		String str = "[-3]";
		TreeNode root = TreeArray.array2tree(HelpDebug.str2array4(str));
		int e = -3;
		int r = this.maxPathSum(root);
		HelpDebug.compare(e, r);
	}

	@Override
	public void debug4() {
		String str = "[1,2]";
		TreeNode root = TreeArray.array2tree(HelpDebug.str2array4(str));
		int e = 3;
		int r = this.maxPathSum(root);
		HelpDebug.compare(e, r);
	}

	public void debug5() {
		String str = "[2,-1]";
		TreeNode root = TreeArray.array2tree(HelpDebug.str2array4(str));
		int e = 2;
		int r = this.maxPathSum(root);
		HelpDebug.compare(e, r);
	}

	public void debug6() {
		String str = "[1,-2,3]";
		TreeNode root = TreeArray.array2tree(HelpDebug.str2array4(str));
		int e = 4;
		int r = this.maxPathSum(root);
		HelpDebug.compare(e, r);
	}

}
